import { validateNull } from "../../../../utils/util";

// pages/service/bind-doctor/doctor-info/doctor-info.ts
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    doctorBaseInfo: Object
  },

  /**
   * 组件的初始数据
   */
  data: {
    doctorInfo: <DoctorEntity>{
      doctorName: '王大壮',
      position: '主任医师',
      doctorPhonenumber: '1312321',
      department: '所属科室名称',
      doctorUid: '12312',
      affiliatedHospital: '长顺医院',
    }
  },

  /**
   * 组件的方法列表
   */
  methods: {
    updateDoctorInfo() {
      if (!validateNull(this.data.doctorBaseInfo)) {
        this.data.doctorInfo = <DoctorEntity>this.data.doctorBaseInfo;
        this.setData({
          doctorInfo: this.data.doctorInfo
        })
      }
    }
  }
})